package com.avecsys.quotemanager.service.supplier;

import java.util.List;

import com.avecsys.quotemanager.exception.BusinessException;
import com.avecsys.quotemanager.exception.UserSessionNotFoundException;
import com.avecsys.quotemanager.pojos.BuyerMasterPojo;
import com.avecsys.quotemanager.pojos.QuoteTransactionEventsPojo;
import com.avecsys.quotemanager.pojos.QuoteTransactionPojo;
import com.avecsys.quotemanager.pojos.SupplierMasterPojo;
import com.avecsys.quotemanager.utils.TransactionStatus;
import com.avecsys.quotemanager.vo.BuyerVO;
import com.avecsys.quotemanager.vo.QuoteVO;
import com.avecsys.quotemanager.vo.SupplierVO;

public interface QuoteTransactionService
{

	/**
	 * Method to save the Quote Transaction
	 * 
	 * @param supplierVO
	 * @return TransactionStatus
	 * @throws BusinessException
	 */
	TransactionStatus saveQuoteTransaction(SupplierVO supplierVO) throws BusinessException;

	/**
	 * Method to list all sent quotes to buyer that belong to a Supplier
	 * 
	 * @param supplierMasterPojo
	 * @return List<QuoteTransactionPojo>
	 * @throws BusinessException
	 */
	List<QuoteTransactionPojo> getAllSentQuotes(SupplierMasterPojo supplierMasterPojo)
			throws BusinessException;

	/**
	 * Method to list all pending Quote transaction Events for Buyer Action
	 * 
	 * @param buyerMasterPojo
	 * @return List<QuoteTransactionEventsPojo>
	 * @throws BusinessException
	 */
	List<QuoteTransactionEventsPojo> getAllQuoteTransactionEventsForBuyer(BuyerMasterPojo buyerMasterPojo)
			throws BusinessException;

	/**
	 * Method to get QuoteTransactionEventsPojo instance by event Id
	 * 
	 * @param eventId
	 * @return QuoteTransactionEventsPojo
	 * @throws BusinessException
	 */
	QuoteTransactionEventsPojo getQuoteTransactionEventById(Long eventId) throws BusinessException;

	/**
	 * Method to mark the transaction status with appropriate transaction
	 * 
	 * @param buyerVO
	 * @return TransactionStatus
	 */
	TransactionStatus replyQuoteEvent(BuyerVO buyerVO) throws BusinessException;

	/**
	 * Method to List all QuoteEvents for a Quote Transaction
	 * 
	 * @param quoteTransactionPojo
	 * @return List<QuoteTransactionEventsPojo>
	 * @throws BusinessException
	 */
	List<QuoteTransactionEventsPojo> getAllQuoteTransactionEvents(
			QuoteTransactionPojo quoteTransactionPojo) throws BusinessException;

	/**
	 * Method to create Supplier Reply Event
	 * 
	 * @param quoteVO
	 * @return TransactionStatus
	 */
	TransactionStatus createQuoteEvent(QuoteVO quoteVO) throws BusinessException,
			UserSessionNotFoundException;

	/**
	 * Method to fetch all the QuoteTransactionPojo by transaction status
	 * 
	 * @param buyerMasterPojo
	 * @param List<String> transactionStatusList
	 * @return List<QuoteTransactionPojo>
	 * @throws BusinessException
	 */
	List<QuoteTransactionPojo> getAllQuoteTransactionsForBuyer(BuyerMasterPojo buyerMasterPojo,
			List<String> transactionStatusList) throws BusinessException;

}
